import { ITodo } from "types/todo";

// 从localStorage中导出所有todo
export const loadTodos = (): ITodo[] => {
  return localStorage.todos ? JSON.parse(localStorage.todos) : [];
};

// 把todos保存到localStorage
export const saveTodos = (todos: ITodo[]) => {
  localStorage.todos = JSON.stringify(todos);
};
